package sist.erp.model.Buy;

import java.util.List;


import javax.servlet.http.*;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;



import sist.erp.db.Buy.BuyManager;
import sist.erp.db.Buy.BuyVO;
import sist.erp.db.Buy.PlanVO;


@Controller
public class BuyController {

	private BuyManager bm;

	public BuyManager getBm() {
		return bm;
	}

	public void setBm(BuyManager bm) {
		this.bm = bm;
	}
	@RequestMapping("purchase/buy.erp")
	public ModelAndView manage() throws Exception{
		ModelAndView mav = new ModelAndView();
		mav.addObject("location","/purchase/buy.jsp");
		mav.setViewName("main/main");
		return mav;
	}
	@RequestMapping("purchase/buycontent.erp")
	public ModelAndView buyAllData(@RequestParam("request_no") int no)
			throws Exception {
		BuyVO vo = bm.buyAllData(no);
		ModelAndView mav = new ModelAndView();
		mav.setViewName("main/main");
		mav.addObject("location", "/purchase/buycontent.jsp");
		mav.addObject("vo",vo);
		return mav;
	}
}